Skip to content

feat(editor): Spec viewport overlays and top-left toggle legend (#1006) - #1250

Open
houko wants to merge 4 commits into
mainfrom
feat/editor-viewport-overlays-1006
Open

houko wants to merge 4 commits into
mainfrom
feat/editor-viewport-overlays-1006

Conversation

@houko

@houko houko commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the Spec viewport overlay line styles and shared top-left toggle legend from docs/design/editor/Spec.dc.html ("Overlay legend") and Main.dc.html:

  • Unified Spec overlay helper (DrawObjectOverlay) & live API (SceneOverlayEntry, SetSceneOverlays) in packages/game/editor/viewport_overlay.go using exclusively SpecPalette tokens across both 2D and 3D viewports:
    • Selection: Accent, 1.5 px solid, four 8×8 corner handles, accent name tag (person's selection only).
    • Agent working: Agent violet, 1.5 px solid, no handles, 1.6 s pulse (100% ↔ 45%), dark pill with 4-point agent glyph or numbered task badge (Holding uses 45% dashed + clock glyph).
    • Added: Added green, 1.5 px dashed, "+ name" pill.
    • Changed: Changed amber, 1.5 px dashed, "field old → new" pill.
    • Removed: Removed red, 1.5 px solid around 25% grey ghost, struck-through name + "removed" pill.
    • Problem: Problem red, 2 px solid on the live object, solid filled alert pill (Problem.Fg / Problem.OnFill) with alert triangle icon and message.
    • Focused change in Review: Own semantic color and dash at 2.5 px with bright outlined pill (never Accent).
    • Selection + Agent pairing: Selection keeps its handles inside while Agent sits 3 px further out (OverlaySelectionAgentGap) with stacked pill.
    • Motion & reduced motion: 240 ms change fade-in (OverlayFadeAlpha) and 1.6 s Agent pulse (OverlayAgentPulseAlpha); with ReduceMotion enabled, overlays appear immediately at 100%, Agent stays solid at 100%, and no animation timer runs.
  • Shared top-left toggle legend (viewport-overlay-legend): Six accessible role="switch" rows (Selection, Agent working, Added, Changed, Removed, Problem) with drawn line-style + second-cue swatches across 2D and 3D viewports, persisted per person in EditorSettings.OverlayLegend (overlayLegend in editor-settings.v1.json) outside project files.
  • Object-level Problem attribution (assetcheck.Problem.Object): Populated on scene object, component, override, and connection diagnostics (and exposed in editormcp's game_check) so live Problem overlays attach directly to objects in 2D and 3D viewports.
  • Neutral viewport guides: Camera frame, camera bounds, camera tether, tile grid, snap grid, and 3D grid/wireframe moved to neutral SpecPalette TextMuted/TextFaint hairline and 2, 4 dotted strokes distinct from all legend kinds.
  • Docs, changelog, and agent note: Updated docs/en/editor.md, docs/zh/editor.md, docs/en/formats.md, docs/zh/formats.md, added changelog.d/editor-viewport-overlays-1006.md, and recorded the decision note in .agents/notes/implemented/feature/2026-11-26-editor-spec-viewport-overlays-legend.md.

Closes #1006

Verification

  • go run ./tools/changelog check — passed (377 fragments)
  • bun run verify-notes — passed (249 notes + 2 archive seals)
  • gofmt -l across all Go files — clean
  • cd packages/game && go run ./cmd/gameschema -check & go tool nsgo test ./cmd/gameschema/... — passed (25/25)
  • cd packages/game && go tool nsgo check -target macos_arm64 — vetted cleanly
  • cd packages/game && go tool nsgo test ./gametest/... — passed (13/13)
  • cd packages/game && go tool nsgo test ./tooling/assetcheck/... — passed (48/48)
  • cd packages/game && go tool nsgo test ./editor/editormcp/... — passed (65/65)
  • cd packages/game && go tool nsgo test ./editor/editorcmd/... — passed (37/37)
  • cd packages/game && go tool nsgo test ./editor -- -run "^(TestViewportOverlay|TestCameraFrameBounds|TestViewport3DPansWithMiddleShiftAndTouchpad|TestSnapGridPlaceAndDragSavesMultiplesOf16|TestSpecTheme|TestSpecContrast|TestEditorSystemAppearanceLiveSwitchWithoutRestart)" — passed (19/19, including 1x & 2x golden PNGs, greyscale distinguishability, reduced motion, legend toggle restart persistence, 2D+3D problem integration, and neutral guide token checks)
  • cd packages/game && go tool nsgo test -target macos -run "^TestViewportOverlaysSpecMacOSScreenshot$" ./editor — passed on native macOS

@github-actions github-actions Bot added enhancement New feature or request size/XL documentation Improvements or additions to documentation pkg/tooling pkg/editor area/website area/agents pkg/gametest conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 3a229c0 to 51e0079 Compare November 26, 2026 11:40
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 51e0079 to 45da115 Compare November 26, 2026 11:59
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 45da115 to 57dc151 Compare November 26, 2026 12:11
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 57dc151 to 9f117d0 Compare November 26, 2026 12:30
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 9f117d0 to 234541a Compare November 26, 2026 12:34
@github-actions github-actions Bot added the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 234541a to 4e30108 Compare November 26, 2026 12:39
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 4e30108 to 836d8d5 Compare November 26, 2026 12:40
@github-actions github-actions Bot added the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 836d8d5 to 86ad895 Compare November 26, 2026 12:48
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 86ad895 to 69f9f54 Compare November 26, 2026 12:58
@github-actions github-actions Bot added the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 69f9f54 to 975c90f Compare November 26, 2026 17:48
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from 975c90f to a28b806 Compare November 26, 2026 17:52
@github-actions github-actions Bot added the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from a28b806 to d84a28d Compare November 26, 2026 17:59
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-viewport-overlays-1006 branch from d84a28d to 0d37d2b Compare November 26, 2026 18:16
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: viewport overlays in the Spec's line styles, with a legend that toggles each kind

1 participant